package school.xauat.inscription_sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import school.xauat.inscription_sys.pojo.Bronzeware;
import school.xauat.inscription_sys.mapper.BronzewareMapper;
import school.xauat.inscription_sys.service.BronzewareService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsy
 * @since 2022-05-03
 */
@Service
public class BronzewareServiceImpl extends ServiceImpl<BronzewareMapper, Bronzeware> implements BronzewareService {

    @Autowired
    BronzewareMapper bronzewareMapper;

    @Override
    public List<Bronzeware> listBronzeware(Integer pageNum, Integer pageSize, String order) {
        Page<Bronzeware> page = new Page<>(pageNum, pageSize);
        Page<Bronzeware> bronzewarePage = bronzewareMapper.selectPage(page, new QueryWrapper<Bronzeware>().orderByDesc(order));
        return bronzewarePage.getRecords();
    }
}
